package com.wc.算法基础课.E第五讲动态规划.计数类DP.整数划分;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/1/17 11:13
 * @description f[i][j] 表示总和为i， j个数的方案
 * 集合最小值为1，集合最小值大于1
 * f[i][j] = f[i - 1][j - 1] + f[i - j][j]
 * https://www.acwing.com/problem/content/902/
 */
public class Main2 {
    static int N = 1010;
    static int[][] f = new int[N][N];
    static int mod = (int) 1e9 + 7;
    static int n;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        f[0][0] = 1;
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= i; j++) {
                f[i][j] = (f[i - 1][j - 1] + f[i - j][j]) % mod;
            }
        }
        int res = 0;
        for (int i = 1; i <= n; i++) res = (res + f[n][i]) % mod;
        System.out.println(res);
    }
}
